<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>02_案例练习-点击按钮修改div元素的宽高以及背景色</title>
        <style>
            div {
                width: 100px;
                height: 80px;
                background-color: aqua;
            }
        </style>
    </head>
    <body>
        <div></div>

        <script>
            var div = document.querySelector('div');

            div.onclick = function(){
                this.style.width = '500px';
                this.style.height = '300px';
                this.style.backgroundColor = 'skyblue';
            }
        </script>
    </body>
</html>